Public Class ClaseDatadrigWow
    Private WithEvents timerDatagrid As New Timer
    Private WithEvents timerdatagrid2 As New Timer
    Private DG As DataGridView
    Private alto As Integer

    Public Event hola()


    Public Sub DatagridWowAltura(ByRef DataGrid As DataGridView)
        MyClass.DG = DataGrid
        MyClass.alto = MyClass.DG.Height
        MyClass.DG.Height = 0
        With MyClass.timerDatagrid
            .Interval = 1
            .Enabled = True
        End With
    End Sub

    Public Sub DataGridAlturaClose(ByRef datagrid As DataGridView)
        MyClass.DG = DataGrid
        MyClass.alto = MyClass.DG.Height
        'MyClass.DG.Height = 0
        With MyClass.timerdatagrid2
            .Interval = 1
            .Enabled = True

        End With
    End Sub

    Private Sub CambiarAlturaDataGridClose(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles timerdatagrid2.Tick
        Try
            MyClass.DG.Height = MyClass.DG.Height - CInt((alto * 3) / 100)
            If (MyClass.DG.Height <= 0) Then
                MyClass.timerdatagrid2.Enabled = False
                MyClass.DG.Height = 0
                RaiseEvent hola()

            End If
        Catch ex As Exception
            timerDatagrid.Enabled = False
        End Try

    End Sub

    Private Sub CambiarAlturaDataGridLoad(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles timerDatagrid.Tick
        Try
            MyClass.DG.Height = MyClass.DG.Height + CInt((alto * 2.5) / 100)
            If (MyClass.DG.Height >= MyClass.alto) Then
                MyClass.timerDatagrid.Enabled = False
                MyClass.DG.Height = alto
            End If
        Catch ex As Exception
            timerDatagrid.Enabled = False
        End Try

    End Sub
End Class
